package com.pulisher.mapper;

import com.pulisher.bean.TrafficSourceBean;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface TrafficStatsMapper {

    @Select("select source_site,sum(uv_ct) uu_ct, sum(sid_ct) sid_ct, ROUND(sum(page_ct)/sum(sid_ct),2) avg_page_view ,ROUND(sum(dur_sum)/sum(sid_ct)) avg_dur_time,ROUND(sum(if(page_ct = 1,1,0))/sum(sid_ct),2) br from dws_traffic_source_window PARTITION (par#{date}) group by source_site")
    List<TrafficSourceBean> selectSource(Integer date);
}
